#include<bits/stdc++.h>

using namespace std;
int a[100010];
int m;
int md;
int sum;
int f = 1;
int u;
int main(){

	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	int n;
	cin>>n;
	for(int i = 1;i <= n;i++){
		int s;
		cin>>s;
		
		a[s]++;
		
	}
	
	for(int i = 1;i <= 100000;i++){
		if(a[i] > 0 and f == 0){
			u = a[i] - m;
			if(u > 0){
				m =  a[i] - m;
				a[md] = 0;
				md = i;
			}else if(u < 0){
				m -= a[i];
				a[i] = 0;
			}else{
				a[md] = 0;
				a[i] = 0;
				f = 1;
			}
			
		} 		
		if(a[i] > 0 and f){
			m = a[i];
			md = i;
			f = 0;
		}

	}
	for(int i = 1;i <= 100000;i++){
		sum += a[i];
	}
	cout<<sum;
	fclose(stdin);
	fclose(stdout);
	
	return 0;
}
